const http = require('http');
const url = require('url');
const {createProxyMiddleware } = require('http-proxy-middleware');

const server = http.createServer((req, res) =>{
  const urlStr = req.url
  if(/\/api/.test(urlStr)) {
    const p = createProxyMiddleware('/api', {
      target: ''
    })
  } else {
    console.log('error');
  }
})

server.listen(8081, ()=>{
  console.log('监听开始了');
})
